/** @format */

const terserJsPlugin = require('terser-webpack-plugin')
const { NODE_ENV } = process.env
const isProd = NODE_ENV === 'production'
module.exports = {
  publicPath: '/zhongbao-static/', //根路径
  outputDir: 'dist', //打包的时候生成的一个文件名
  lintOnSave: false,
  // transpileDependencies: ['vue-qr'],
  configureWebpack: {
    devtool: 'souce-map',
    plugins: isProd
      ? [
          new terserJsPlugin({
            terserOptions: {
              compress: {
                join_vars: true,
                warnings: false,
                drop_console: true,
                drop_debugger: true
              },
              toplevel: false,
              ie8: false
            }
          })
        ]
      : []
  }
}
